home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Utility Spectacular / Developer / SAT / SATminimal ƒ / SATminimal.p < prev    next >
Encoding:
Text File  |  1994-07-26  |  1.0 KB  |  41 lines  |  [TEXT/PJMM]

  1. {Minimal demo program, with a few sprites moving back and forth.}
  2.  
  3. program SATminimal;
  4.  
  5.     uses
  6.         SAT, sMySprite;
  7.     var
  8.         ignoreSp: SpritePtr;
  9.         l: longint;
  10. begin
  11. {Standard Inits are done by Think Pascal.}
  12.  
  13. {Initialize, using PICTs 128 or 129 as background, Classic-sized drawing area}
  14.     InitSAT(128, 129, 512, 322);
  15.  
  16. {Initialize sprite unit(s)}
  17.     InitMySprite;
  18.  
  19. {Show the window and update it.}
  20.     ShowWindow(gSAT.wind);
  21.     SelectWindow(gSAT.wind);
  22.     PeekOffscreen;
  23.  
  24. {Make some sprites}
  25.     ignoreSp := NewSprite(0, 50, 50, @SetupMySprite);
  26.     ignoreSp := NewSprite(0, 100, 100, @SetupMySprite);
  27.     ignoreSp := NewSprite(0, 125, 120, @SetupMySprite);
  28.     ignoreSp := NewSprite(0, 150, 140, @SetupMySprite);
  29.     ignoreSp := NewSprite(0, 200, 180, @SetupMySprite);
  30.     ignoreSp := NewSprite(0, 250, 200, @SetupMySprite);
  31.     ignoreSp := NewSprite(0, 300, 250, @SetupMySprite);
  32.  
  33.     repeat
  34.         l := TickCount;
  35.         RunSAT(true); {Run one frame of animation}
  36.         while l > TickCount - 3 do {Maximize speed to 20 fps}
  37.             ;
  38.     until Button;
  39.  
  40.     SATSoundShutUp; {Always de-allocate the sound channel before quitting!}
  41. end.